<script setup>
import MenuComVue from "@/components/menuCom.vue";

let store = useStore();

defineProps(["menuList"]);

let savePath = (path) => {
  store.commit("SAVE_MENUPATH", path);
};
</script>


<template>
  <div>
    <div v-for="item in menuList" :key="item.id">
      <el-sub-menu v-if="item.children?.length" :index="item.path">
        <template #title>
          <!-- <el-icon><location /></el-icon> -->
          <span>{{ item.authName }}</span>
        </template>
        <el-menu-item-group>
          <MenuComVue :menuList="item.children"></MenuComVue>
        </el-menu-item-group>
      </el-sub-menu>
      <el-menu-item @click="savePath(item.path)" v-else :index="item.path">
        <!-- <el-icon><icon-menu /></el-icon> -->
        <span>{{ item.authName }}</span>
      </el-menu-item>
    </div>
  </div>
</template>


<style lang="scss" scoped>
</style>